feat: persist grep-friendly local thread history - #18
Open
davefmurray wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: 0bcd5b8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CLI currently displays live threads but leaves no local copy to search later. This adds automatic, grep-friendly JSONL history at
~/.grok-bot-cli/history.jsonl: successfulsendcommands record prompts, andthread/chatrecord fetched messages with full text, target IDs/names, roles, recording times, and available message/root IDs.History commands run offline before backend/auth initialization.
--history-dir/GROK_BOT_HISTORY_DIRconfigure storage;--no-history/GROK_BOT_HISTORY=offdisable recording. New directories/files use 0700/0600 permissions, writes refuse file symlinks, and only conversation fields are saved. Disk failures warn on stderr without making a successful send look failed. Reads skip malformed records, and the next append separates an interrupted final record.This records CLI observations: replies are saved when fetched, repeated fetches append repeated observations, and there is no background sync, deduplication, expiry, or session resumption. Conversation text is stored as plaintext; these limits and opt-outs are documented.
The shared transcript parser also handles array-shaped responses correctly and prefers full content over previews. Includes README/help updates and a minor changeset.
Validation: all 34 tests pass on Node 18, 22, and 24, including 10 new integration tests using a local mock gateway and isolated temporary homes. Coverage includes persistence across processes, real grep, bot/group filtering, multiline/long content, opt-outs, failed sends, disk errors, concurrent appends, and malformed history. Publint 0.3.24 and packed executable install/help/offline-history smoke checks pass. No live bot operations were used.